package com.kx.center.controller;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.kx.center.util.FileUploadUtils;

/**
 * 文件上传测试
 * 
 * @description
 * @version 1.0
 * @author Scott
 * @date 2016年1月18日 下午5:02:06
 */
@Controller
@RequestMapping("file")
public class FileUploadController {

	@RequestMapping(value = "/upload", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
	@ResponseBody
	public String uploadFile(HttpServletRequest request) {

		List<String> pathList = FileUploadUtils.tranferFile(request, "/upload");
		for(int i=0;i<pathList.size();i++){
			System.out.println(pathList.get(i));
		}
		return "";
	}
}
